package com.heima.feign.Wemedia;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.xml.ws.Response;

@FeignClient(value = "leadnews-wemedia",path = "wemedia")
public interface IWemediaClient {


    /**
     * 按名称查找 WM 用户
     *
     * @param name 名字
     * @return {@link WmUser}
     */
    @GetMapping("/api/v1/user/findByName")
    WmUser getUsername(@RequestParam("name") String name);

    /**
     * 创建媒体帐户
     *
     * @param wmUser WM 用户
     */
    @PostMapping("/api/v1/wm_user/save")
    void createMediaAccount(WmUser wmUser);


    @GetMapping("/api/v1/channel/channels")
    ResponseResult channels();
}
